package cate.game.train.awakenfairy.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

import java.util.List;

@ClientMsg(title = "觉醒灵器分解 の 请求")
@OperationSetter(GDOperation.AWAKEN_FAIRY_DECOMPOSE)
public class AwakenFairyDecomposeReq implements MsgInput {
    @NoteField(value = "觉醒灵器的uid")
    public List<String> awakenFairyUids;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.awakenFairy.decomposed(cc.getRole(), awakenFairyUids);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.AWAKEN_FAIRY_DECOMPOSE_REQ;
    }
}
